﻿<Window x:Class="WpfApplication4.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wpfApplication4="clr-namespace:WpfApplication4"
        Title="MainWindow" Height="350" Width="525">
    
    <Window.Resources>

        <DataTemplate DataType="{x:Type wpfApplication4:CommandViewModel}">
            <Button Content="{Binding Path=DisplayText}" Command="{Binding Path=Command}" />
        </DataTemplate>

        <DataTemplate DataType="{x:Type wpfApplication4:ViewModelA}">
           <wpfApplication4:ViewA />
        </DataTemplate>
        <DataTemplate DataType="{x:Type wpfApplication4:ViewModelB}">
            <wpfApplication4:ViewB />
        </DataTemplate>
        <DataTemplate DataType="{x:Type wpfApplication4:ViewModelC}">
            <wpfApplication4:ViewC/>
        </DataTemplate>

    </Window.Resources>
    
    <Grid>
        
        <StackPanel Orientation="Horizontal">
            
            <ItemsControl Width="200" ItemsSource="{Binding Path=Commands}" />
            
            <ContentControl Content="{Binding Path=MainPanel}" />
            
        </StackPanel>
        
    </Grid>
</Window>
